{% extends "base.html" %}
{% load thumbnail %}

{% block title %}Show Listing{% endblock %}

{% block jscript %}
$(document).ready(function()
    {
        $("#showsTable").tablesorter();
    }
);
{% endblock %}

{% block content %}
<h2>TV Shows</h2>
<form method="post">
<table id="showsTable">
    <thead>
    <tr>
        <th></th>
        <th align=left>Fav</th>
        <th align=left>Name</th>
        <th align=left>Genre</th>
        <th align=left>Runtime</th>
        <th align=left>Status</th>
        <th align=left>First Aired</th>
    </tr>
    </thead>
    <tbody>
{% for show in shows %}
    <tr class="{% cycle 'odd' 'even' %}">
        <td><img src="{% thumbnail show.poster_filename 48x70 %}"></td>
        <td><input type="checkbox" name="fav" value="{{show.id}}" {% if show.is_fav %}checked{% endif %} /></td>
        <td><a href="{% url tv.views.show_detail show_id=show.id %}">{{ show.name }}</a></td>
        <td>{{ show.genre }}</td>
        <td>{{ show.runtime }}</td>
        <td>{{ show.status }}</td>
        <td>{{ show.first_aired }}</td>
    </tr>
{% endfor %}
    </tbody>
</table>
<input type="Submit" value="Update Favourites" />
</form>
{% endblock %}
